# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo08
# Description:
# Author:       98745
# Date:         2019/3/9
#-------------------------------------------------------------------------------

from heapq import *
from random import *
data=[1,2,3,4,5,6,7,8,9]
h=[]
for n in data:
    v=choice(data)
    heappush(h,v)
print(h)
heappush(h,2.5)
print(h)
print(heappop(h))

h1=[6,3,12,1,8]
heapify(h1)
print(h1)
heapreplace(h1,100)
print(h1)
print(nlargest(1,h1))
print(nlargest(2,h1))
print(nsmallest(1,h1))
print(nsmallest(3,h1))
print(list(merge([1,3,1234,7],[0,2,4,8],[5,10,15,20],[],[25])))
print(list(merge(['dog','horse'],['cat','fish','kangaroo'])))
